package org.monster.context.core.request;

import org.monster.context.core.Constants;

/**
 * 请求工厂
 *
 * @author Monster
 */
public class RequestFactory {

    /**
     * 获取实例
     *
     * @param method 方法
     * @return 请求
     */
    public Request getInstance(String method) {
        if (method != null) {
            Request process = null;
            if (method.equalsIgnoreCase(Constants.METHOD_DOS)) {
                process = new RequestDos();
            } else if (method.equalsIgnoreCase(Constants.METHOD_GET)) {
                process = new RequestGet();
            } else if (method.equalsIgnoreCase(Constants.METHOD_POST)) {
                process = new RequestPost();
            }
            return process;
        }
        return null;
    }
}
